/*
 * @Author: yfp
 * @Date: 2024-03-31 11:45:09
 * @LastEditors: yehongbo 1394168736@qq.com
 * @LastEditTime: 2024-08-09 17:58:27
 * @Description: 
 */
import Request from "@/utils/request"

// const baseUrl = ["production", "test"].includes(process.env.NODE_ENV) ? "/operationcontrol" : "/api/doms/operationcontrolservice"

const request = new Request({})

export default {
  /**
   * 历史记录列表
   * @param data
   * @returns
   */
  getHisRecordList(data) {
    return request.post(`/api/history`, JSON.stringify(data), {
      headers: { "Content-Type": "application/json" },
    });
  },
  // 2文件上传、模型推理接口
  uploadFile(data) {
    return request.post(`/api/send_predict`, data, {
      headers: { "Content-Type": "multipart/form-data" },
    });
  },
  // 获取数据状态
  getStatus() {
    return request.get('/api/task_status', {
      headers: { "Content-Type": "application/json" }
    })
  },
  downloadFile(filename) {
    return request.get('/api/download/' + filename, {
      responseType: 'blob'
      // headers: { "Content-Type": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" },
    })
  },
  getSlide() {
    return request.post(`/api/slide`, {
      // headers: { "Content-Type": "application/json" },
      headers: { "Content-Type": "application/json; chartset=utf-8" },
    });
  },
  getDataGrp() {
    return request.post(`/api/pop`, {
      // headers: { "Content-Type": "application/json" },
      headers: { "Content-Type": "application/json; chartset=utf-8" },
    });
  },
  getHisRecordList1(data) {
    return request.post(`/api/info`, JSON.stringify(data), {
      headers: { "Content-Type": "application/json; chartset=utf-8" },
    });
  },
  deleteData(data) {
    return request.post(`/api/delete`, JSON.stringify(data), {
      headers: { "Content-Type": "application/json" }
    });
  },
  setYesList(data) {
    return request.post(`/api/show`, JSON.stringify(data), {
      headers: { "Content-Type": "application/json" }
    });
  },
  saveInfo(data) {
    return request.post(`/api/save_info`, JSON.stringify(data), {
      headers: { "Content-Type": "application/json" }
    });
  },
  showSave(data) {
    return request.post(`/api/show_save`, JSON.stringify(data), {
      headers: { "Content-Type": "application/json" }
    });
  },
  setClean(data) {
    return request.post(`/api/clean`, JSON.stringify(data), {
      headers: { "Content-Type": "application/json" }
    });
  },
  setListData(data) {
    return request.post(`/api/page`, JSON.stringify(data), {
      headers: { "Content-Type": "application/json" }
    });
  },
  getLisData() {
    return request.post(`/api/show_page`, {
      headers: { "Content-Type": "application/json" }
    });
  },

};
